<template>
  <div>
    <h1>{{community.title}}</h1>
    {{community.content}}
    {{content}}
    <!-- <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
      <el-form-item size="large">
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form> -->
  </div>
</template>
<script>
import { getCommunity, getCommunityContent } from '../../../api/communitys/community';

export default {
  components: {},
  props: [],
  data() {
    return {
      content:"",
      community:{

      },
      formData: {},
      rules: {},
    }
  },
  computed: {},
  watch: {},
  created() {
    const id =this.$route.query.id
    console.log(id);
    getCommunity(id).then(res=>{
      console.log(res);
      this.community=res.data
    })
    getCommunityContent(id).then(res=>{
      this.content=res.data.content
    })
  },
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>
</style>
